package com.nmf.dao.gen;

import com.nmf.dao.gen.bean.BizApplyPeriod;
import com.nmf.dao.gen.bean.BizApplyPeriodExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizApplyPeriodMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @SelectProvider(type=BizApplyPeriodSqlProvider.class, method="countByExample")
    long countByExample(BizApplyPeriodExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @DeleteProvider(type=BizApplyPeriodSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizApplyPeriodExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @Delete({
        "delete from biz_apply_period",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @Insert({
        "insert into biz_apply_period (id, category_id, ",
        "category_name, sub_category_id, ",
        "sub_category_name, apply_type, ",
        "start_date, end_date, ",
        "create_date, create_by, ",
        "update_date, update_by)",
        "values (#{id,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR}, ",
        "#{categoryName,jdbcType=VARCHAR}, #{subCategoryId,jdbcType=VARCHAR}, ",
        "#{subCategoryName,jdbcType=VARCHAR}, #{applyType,jdbcType=VARCHAR}, ",
        "#{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP}, ",
        "#{createDate,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR}, ",
        "#{updateDate,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR})"
    })
    int insert(BizApplyPeriod record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @InsertProvider(type=BizApplyPeriodSqlProvider.class, method="insertSelective")
    int insertSelective(BizApplyPeriod record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @SelectProvider(type=BizApplyPeriodSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="category_id", property="categoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="category_name", property="categoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_category_id", property="subCategoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_category_name", property="subCategoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="apply_type", property="applyType", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_date", property="startDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_date", property="endDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR)
    })
    List<BizApplyPeriod> selectByExample(BizApplyPeriodExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @Select({
        "select",
        "id, category_id, category_name, sub_category_id, sub_category_name, apply_type, ",
        "start_date, end_date, create_date, create_by, update_date, update_by",
        "from biz_apply_period",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="category_id", property="categoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="category_name", property="categoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_category_id", property="subCategoryId", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_category_name", property="subCategoryName", jdbcType=JdbcType.VARCHAR),
        @Result(column="apply_type", property="applyType", jdbcType=JdbcType.VARCHAR),
        @Result(column="start_date", property="startDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_date", property="endDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.VARCHAR),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.VARCHAR)
    })
    BizApplyPeriod selectByPrimaryKey(String id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @UpdateProvider(type=BizApplyPeriodSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizApplyPeriod record, @Param("example") BizApplyPeriodExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @UpdateProvider(type=BizApplyPeriodSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizApplyPeriod record, @Param("example") BizApplyPeriodExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @UpdateProvider(type=BizApplyPeriodSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BizApplyPeriod record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table biz_apply_period
     */
    @Update({
        "update biz_apply_period",
        "set category_id = #{categoryId,jdbcType=VARCHAR},",
          "category_name = #{categoryName,jdbcType=VARCHAR},",
          "sub_category_id = #{subCategoryId,jdbcType=VARCHAR},",
          "sub_category_name = #{subCategoryName,jdbcType=VARCHAR},",
          "apply_type = #{applyType,jdbcType=VARCHAR},",
          "start_date = #{startDate,jdbcType=TIMESTAMP},",
          "end_date = #{endDate,jdbcType=TIMESTAMP},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "create_by = #{createBy,jdbcType=VARCHAR},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BizApplyPeriod record);
}